<?php


namespace App\Imports;

use Illuminate\Support\Facades\Route;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
use Maatwebsite\Excel\Concerns\WithStartRow;

/**
 * Created By FreeAbrams
 * Date: 2020/11/27
 */
class StaffImport implements WithMultipleSheets
{
	// 排班表统计时间
	protected $import_time = '';
	
	public function __construct($import_time)
	{
		$this->import_time = $import_time;
	}
	
	public function sheets(): array
	{
		if (Route::currentRouteName() == 'attendance.import') {
			return [
				'考勤汇总表' => new Attendances($this->import_time),
			];
		} else {
			return [
				'排班记录表' => new SchedulesImports($this->import_time),
			];
		}
	}
}